<template>
  <div>
    <Snackbars :text="text" :value="isShow"/>
    <v-btn block :color="'#DC143C'" @click="outLogin" outlined>
      <span>退出登录</span>
      <v-icon
          :color="'red'">
        mdi-info
      </v-icon>
    </v-btn>
  </div>
</template>

<script lang="ts">
import Vue from 'vue'
import Snackbars from "@/components/Snackbars";
export default Vue.extend({
  name: 'OutLogin',
  data: () => ({
    text: '',
    isShow: false
  }),
  components: {
    Snackbars
  },
  methods: {
    outLogin(){
      localStorage.removeItem('token')
      this.$store.commit('user/removeInfo')
      this.text = '退出登录成功'
      this.$router.push('/home')
    }
  }
})
</script>

<style scoped>

</style>